package com.wu.flandre.component;


/**
 * 全局变量
 *
 * @author 50816
 * @date 2019年12月1日 20:31:08
 */
public class GlobalConstant {
    /**
     * 自定义返回信息
     */
    public static final Integer SUCCESS_CODE = 200;
    public static final Integer FAIL_CODE = 400;
    public static final Integer EXCEPTION_CODE = 500;
    public static final Integer UNAUTHORIZED = 300;
    public static final String DEFAULT_JSON_MSG_RETURN = "调用接口成功";
    /**
     * HTTP请求工具的请求类型
     */
    public static final String DO_GET = "get";
    public static final String DO_POST = "post";
    public static final String DO_PUT = "put";
    public static final String DO_DELETE = "delete";
    /**
     * 接口权限验校参数
     */
    public static final Integer AUTH_NO = 0;
    public static final Integer AUTH_USER = 1;
    public static final Integer AUTH_ADMIN = 2;
    public static final Integer AUTH_SUPER_ADMIN = 3;
    /**
     * 微信消息类型
     */
    public static final String TEXT_MSG_TYPE = "text";
    public static final String IMG_MSG_TYPE = "image";
    public static final String VOICE_MSG_TYPE = "voice";
    public static final String VIDEO_MSG_TYPE = "video";
    public static final String SHORTVIDEO_MSG_TYPE = "shortvideo";
    public static final String LOCATION_MSG_TYPE = "location";
    public static final String LINK_MSG_TYPE = "link";
    public static final String NEWS_MSG_TYPE = "news";
    /**
     * 微信API服务器基础URL
     */
    public static final String WECHAT_BASE_URL_API = "https://api.weixin.qq.com";
    public static final String WECHAT_BASE_URL_OPEN = "https://open.weixin.qq.com";
    /**
     * 获取Token的接口api
     */
    public static final String GET_ACCESS_TOKEN_URL = WECHAT_BASE_URL_API + "/cgi-bin/token";
    /**
     * 微信默认回复
     */
    public static final String DEFAULT_MSG_RETURN = "你的留言已经收到,感谢回复";
    /**
     * 微信授权登陆作用域Base和Info
     */
    public static final String H5_OAUTH_SCOPE_BASE = "snsapi_base";
    public static final String H5_OAUTH_SCOPE_INFO = "snsapi_userinfo";
    /**
     * H5页面Oauth登录,获取code的URL
     */
    public static final String GET_CODE_URL = WECHAT_BASE_URL_OPEN + "/connect/oauth2/authorize?appid=${appId}&redirect_uri=${redURL}&response_type=code&scope=${scope}&state=success#wechat_redirect";

    public static final String CODE_TO_ACCESSTOKEN_URL = WECHAT_BASE_URL_API + "/sns/oauth2/access_token?appid=${appId}&secret=${secret}&code=${code}&grant_type=authorization_code";

    public static final String WINDOWS_OS = "windows";
    public static final String LINUX_OS = "linux";
}
